<template>
	<view>
		<view class="Nav"
			style="width: 750rpx;height: 193rpx;background: linear-gradient(91deg, #5CD3E1 0%, #70E5D5 100%);padding: 110rpx 303rpx 33rpx 303rpx;font-weight: bold;font-size: 36rpx;color: #FFFFFF;text-align: center;position: fixed;top: 0;left: 0;">
			{{data.class_name}}
		</view>
		<view style="height: 193rpx;">

		</view>
		<view class="Box" v-if="data.filter">
			<view class="Item" v-for="A,B in data.filter.child_cats" @click="goClass(A.id)">
				<image src="/static/logo.png" style="width: 335rpx;height: 335rpx;" mode=""></image>
				{{A.name}}
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				data: {},
			};
		},
		onLoad(e) {
			this.$api.goodsList({
				limit: 100,
				order: 'sort asc',
				page: 1,
				where: `{\"cat_id\":\"${e.id}\"}`
			}, res => {
				this.data = res.data
			})
		},
		methods: {
			goodsDetail: function(id) {
				let url = '/pages/goods/index/index?id=' + id;
				this.$common.navigateTo(url);
			},
			goClass(cat_id) {
				uni.navigateTo({
					url: '/pages/classify/index?id=' + cat_id
				});
			},
		}
	}
</script>

<style lang="scss" scoped>
	.Box {
		display: flex;
	}

	.Item {
		display: flex;
		flex-direction: column;
		align-items: center;
		image{
			border-radius: 20rpx;
		}
	}
</style>